<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>社交活动平台 - 安全中心</title>
    <style>
        /* 重置样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            background-color: #f5f7fa;
            color: #333;
            line-height: 1.6;
        }

        /* 容器样式 */
        .container {
            max-width: 480px;
            margin: 0 auto;
            background-color: #fff;
            min-height: 100vh;
        }

        /* 头部导航 */
        .header {
            position: sticky;
            top: 0;
            background-color: white;
            padding: 16px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            z-index: 100;
        }

        .header-content {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .back-btn {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #333;
        }

        .header-title {
            font-size: 18px;
            font-weight: bold;
            flex-grow: 1;
            text-align: center;
        }

        .action-btn {
            background: none;
            border: none;
            font-size: 20px;
            cursor: pointer;
            color: #333;
        }

        /* 用户安全信息区域 */
        .user-security-section {
            padding: 24px 16px;
            text-align: center;
            background: linear-gradient(135deg, #ff6b35 0%, #f9a825 100%);
            color: white;
            position: relative;
        }

        .security-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 40px;
            margin: 0 auto 16px;
            border: 3px solid rgba(255, 255, 255, 0.3);
        }

        .security-name {
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 4px;
        }

        .security-status {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-size: 14px;
        }

        .status-indicator {
            width: 8px;
            height: 8px;
            border-radius: 50%;
        }

        .status-secure {
            background-color: #4caf50;
        }

        .status-warning {
            background-color: #ff9800;
        }

        /* 安全等级指示器 */
        .security-level {
            margin-top: 16px;
            padding: 8px 16px;
            background-color: rgba(255, 255, 255, 0.2);
            border-radius: 20px;
            display: inline-block;
        }

        .security-level-text {
            font-size: 14px;
            font-weight: bold;
        }

        /* 安全设置菜单 */
        .security-menu {
            padding: 16px 0;
        }

        /* 安全设置项 */
        .security-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            border-bottom: 1px solid #eee;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .security-item:hover {
            background-color: #f9f9f9;
        }

        .security-icon {
            width: 24px;
            height: 24px;
            margin-right: 16px;
            color: #ff6b35;
        }

        .security-content {
            flex-grow: 1;
        }

        .security-title {
            font-size: 16px;
            font-weight: 500;
            margin-bottom: 4px;
        }

        .security-description {
            font-size: 13px;
            color: #999;
        }

        .security-status-badge {
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: bold;
        }

        .badge-verified {
            background-color: #e8f5e9;
            color: #388e3c;
        }

        .badge-unverified {
            background-color: #fff8e1;
            color: #ff8f00;
        }

        .badge-warning {
            background-color: #ffebee;
            color: #e53935;
        }

        .arrow-icon {
            color: #ccc;
            font-size: 18px;
        }

        /* 安全建议卡片 */
        .security-tips {
            margin: 20px 16px;
            padding: 16px;
            background-color: #f9f9f9;
            border-radius: 12px;
        }

        .tips-title {
            font-size: 16px;
            font-weight: bold;
            margin-bottom: 12px;
            color: #333;
        }

        .tips-list {
            list-style-type: none;
        }

        .tip-item {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            margin-bottom: 12px;
        }

        .tip-icon {
            font-size: 18px;
            margin-top: 2px;
        }

        .tip-text {
            font-size: 14px;
            color: #666;
        }

        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: white;
            border-top: 1px solid #eee;
            display: flex;
            justify-content: space-around;
            padding: 12px 0;
            z-index: 100;
        }

        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: #9e9e9e;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .nav-item.active {
            color: #ff6b35;
        }

        .nav-icon {
            font-size: 20px;
            margin-bottom: 4px;
        }

        /* 加载动画 */
        .loading {
            text-align: center;
            padding: 40px 20px;
        }

        .spinner {
            width: 36px;
            height: 36px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid #ff6b35;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* 弹窗样式 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        .modal-content {
            background-color: white;
            border-radius: 16px;
            width: 85%;
            max-width: 320px;
            padding: 24px;
            text-align: center;
            transform: translateY(20px);
            opacity: 0;
            transition: all 0.3s ease;
        }

        .modal.show {
            transform: translateY(0);
            opacity: 1;
        }

        .modal-title {
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 16px;
            color: #333;
        }

        .modal-message {
            margin-bottom: 24px;
            color: #666;
            line-height: 1.6;
        }

        .modal-actions {
            display: flex;
            gap: 12px;
        }

        .modal-btn {
            flex: 1;
            padding: 12px;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .cancel-btn {
            background-color: #f5f5f5;
            color: #666;
        }

        .confirm-btn {
            background: linear-gradient(135deg, #ff6b35 0%, #f9a825 100%);
            color: white;
        }

        /* 响应式适配 */
        @media (max-width: 480px) {
            .header-content {
                padding-top: 4px;
            }
            
            .security-item {
                padding: 16px 16px;
            }
        }

        /* 动画效果 */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .security-item {
            animation: fadeInUp 0.6s ease forwards;
        }

        /* 安全设置图标样式 */
        .icon-security { color: #e91e63; }
        .icon-verification { color: #4caf50; }
        .icon-password { color: #2196f3; }
        .icon-device { color: #ff9800; }
        .icon-privacy { color: #9c27b0; }

        /* 安全等级指示器 */
        .level-indicator {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            margin-top: 8px;
        }

        .level-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
        }

        .level-dot.secure { background-color: #4caf50; }
        .level-dot.warning { background-color: #ff9800; }
        .level-dot.danger { background-color: #f44336; }

        /* 安全建议卡片 */
        .security-card {
            background-color: #fff8e1;
            border-left: 4px solid #ff9800;
            padding: 16px;
            border-radius: 0 8px 8px 0;
            margin: 16px 0;
        }

        .security-card-title {
            font-weight: bold;
            margin-bottom: 8px;
            color: #ff6d00;
        }

        .security-card-content {
            font-size: 14px;
            color: #5d4037;
        }

        /* 紧急联系人设置 */
        .emergency-contact {
            display: flex;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid #eee;
        }

        .emergency-info {
            flex-grow: 1;
        }

        .emergency-name {
            font-size: 14px;
            margin-bottom: 4px;
        }

        .emergency-phone {
            font-size: 12px;
            color: #999;
        }

        .emergency-actions {
            display: flex;
            gap: 12px;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 头部导航 -->
        <header class="header">
            <div class="header-content">
                <button class="back-btn" id="backBtn">←</button>
                <div class="header-title">安全中心</div>
                <button class="action-btn" id="refreshBtn">🔄</button>
            </div>
        </header>

        <!-- 用户安全信息区域 -->
        <div class="user-security-section">
            <div class="security-avatar">👤</div>
            <div class="security-name">张小明</div>
            <div class="security-status">
                <span class="status-indicator status-secure"></span>
                <span>账户安全</span>
            </div>
            <div class="security-level">
                <span class="security-level-text">安全等级：高</span>
            </div>
        </div>

        <!-- 安全建议卡片 -->
        <div class="security-tips">
            <h3 class="tips-title">安全建议</h3>
            <ul class="tips-list">
                <li class="tip-item">
                    <span class="tip-icon">🔒</span>
                    <div class="tip-text">定期更换密码，使用复杂组合</div>
                </li>
                <li class="tip-item">
                    <span class="tip-icon">📱</span>
                    <div class="tip-text">开启双重验证，提升账户安全性</div>
                </li>
                <li class="tip-item">
                    <span class="tip-icon">🌐</span>
                    <div class="tip-text">避免在公共网络环境下登录</div>
                </li>
            </ul>
        </div>

        <!-- 安全设置菜单 -->
        <div class="security-menu">
            <!-- 账户安全 -->
            <div class="section-title">账户安全</div>
            
            <!-- 实名认证 -->
            <div class="security-item" id="identityVerification">
                <div style="display: flex; align-items: center;">
                    <span class="security-icon icon-verification">🆔</span>
                    <div class="security-content">
                        <div class="security-title">实名认证</div>
                        <div class="security-description">完成身份验证，提升账户安全性</div>
                    </div>
                </div>
                <span class="security-status-badge badge-verified">已认证</span>
                <span class="arrow-icon">›</span>
            </div>

            <!-- 密码管理 -->
            <div class="security-item" id="passwordManagement">
                <div style="display: flex; align-items: center;">
                    <span class="security-icon icon-password">🔑</span>
                    <div class="security-content">
                        <div class="security-title">密码管理</div>
                        <div class="security-description">修改登录密码和支付密码</div>
                    </div>
                </div>
                <span class="arrow-icon">›</span>
            </div>

            <!-- 双重验证 -->
            <div class="security-item" id="twoFactorAuth">
                <div style="display: flex; align-items: center;">
                    <span class="security-icon icon-security">🔒</span>
                    <div class="security-content">
                        <div class="security-title">双重验证</div>
                        <div class="security-description">开启二次验证，增强账户安全</div>
                    </div>
                </div>
                <span class="security-status-badge badge-verified">已开启</span>
                <span class="arrow-icon">›</span>
            </div>

            <!-- 登录设备 -->
            <div class="security-item" id="loginDevices">
                <div style="display: flex; align-items: center;">
                    <span class="security-icon icon-device">📱</span>
                    <div class="security-content">
                        <div class="security-title">登录设备</div>
                        <div class="security-description">管理当前和历史登录设备</div>
                    </div>
                </div>
                <span class="arrow-icon">›</span>
            </div>

            <!-- 隐私设置 -->
            <div class="security-item" id="privacySettings">
                <div style="display: flex; align-items: center;">
                    <span class="security-icon icon-privacy">🔒</span>
                    <div class="security-content">
                        <div class="security-title">隐私设置</div>
                        <div class="security-description">控制个人信息可见范围</div>
                    </div>
                </div>
                <span class="arrow-icon">›</span>
            </div>

            <!-- 紧急联系人 -->
            <div class="security-item" id="emergencyContact">
                <div style="display: flex; align-items: center;">
                    <span class="security-icon icon-security">🚑</span>
                    <div class="security-content">
                        <div class="security-title">紧急联系人</div>
                        <div class="security-description">设置安全紧急情况下的联系人</div>
                    </div>
                </div>
                <span class="security-status-badge badge-verified">已设置</span>
                <span class="arrow-icon">›</span>
            </div>

            <!-- 安全检测 -->
            <div class="security-item" id="securityCheck">
                <div style="display: flex; align-items: center;">
                    <span class="security-icon icon-security">🔍</span>
                    <div class="security-content">
                        <div class="security-title">安全检测</div>
                        <div class="security-description">定期检查账户安全状况</div>
                    </div>
                </div>
                <span class="arrow-icon">›</span>
            </div>

            <!-- 安全日志 -->
            <div class="security-item" id="securityLog">
                <div style="display: flex; align-items: center;">
                    <span class="security-icon icon-security">📊</span>
                    <div class="security-content">
                        <div class="security-title">安全日志</div>
                        <div class="security-description">查看账户操作记录和异常行为</div>
                    </div>
                </div>
                <span class="arrow-icon">›</span>
            </div>

            <!-- 举报投诉 -->
            <div class="security-item" id="reportComplaint">
                <div style="display: flex; align-items: center;">
                    <span class="security-icon icon-security">⚠️</span>
                    <div class="security-content">
                        <div class="security-title">举报投诉</div>
                        <div class="security-description">举报违规行为，维护平台安全</div>
                    </div>
                </div>
                <span class="arrow-icon">›</span>
            </div>

            <!-- 安全等级 -->
            <div class="security-item" id="securityLevel">
                <div style="display: flex; align-items: center;">
                    <span class="security-icon icon-security">⭐</span>
                    <div class="security-content">
                        <div class="security-title">安全等级</div>
                        <div class="security-description">当前账户安全等级评估</div>
                    </div>
                </div>
                <span class="security-status-badge badge-verified">高</span>
                <span class="arrow-icon">›</span>
            </div>

            <!-- 安全等级详情 -->
            <div class="security-card">
                <div class="security-card-title">安全等级详情</div>
                <div class="security-card-content">
                    您的账户已通过多项安全检测，包括实名认证、密码强度检查和设备验证。建议继续保持良好安全习惯。
                </div>
            </div>

            <!-- 紧急联系人设置 -->
            <div class="emergency-contact">
                <div class="emergency-info">
                    <div class="emergency-name">张妈妈</div>
                    <div class="emergency-phone">138****5678</div>
                </div>
                <div class="emergency-actions">
                    <button class="action-btn" style="color: #ff6b35;">编辑</button>
                </div>
            </div>
        </div>

        <!-- 底部导航 -->
        <nav class="bottom-nav">
            <div class="nav-item" data-page="home">
                <span class="nav-icon">🏠</span>
                <span>首页</span>
            </div>
            <div class="nav-item" data-page="search">
                <span class="nav-icon">🔍</span>
                <span>搜索</span>
            </div>
            <div class="nav-item" data-page="publish">
                <span class="nav-icon">➕</span>
                <span>发布</span>
            </div>
            <div class="nav-item active" data-page="profile">
                <span class="nav-icon">👤</span>
                <span>我的</span>
            </div>
        </nav>

        <!-- 安全检测弹窗 -->
        <div class="modal" id="securityCheckModal">
            <div class="modal-content">
                <h3 class="modal-title">安全检测</h3>
                <p class="modal-message">
                    我们正在为您进行全面的安全检测：<br><br>
                    • 密码强度检查<br>
                    • 登录设备验证<br>
                    • 账户活动分析<br>
                    • 安全设置完整性检查
                </p>
                <div class="modal-actions">
                    <button class="modal-btn cancel-btn" id="cancelCheckBtn">取消</button>
                    <button class="modal-btn confirm-btn" id="confirmCheckBtn">开始检测</button>
                </div>
            </div>
        </div>

        <!-- 加载状态 -->
        <div class="loading" id="loadingIndicator">
            <div class="spinner"></div>
            <p>安全检测中...</p>
        </div>

        <!-- 通知 Toast -->
        <div id="toast" style="display: none; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background-color: #4caf50; color: white; padding: 12px 24px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 1001;"></div>
    </div>

    <script>
        // 全局变量
        let securityData = {
            identityVerified: true,
            twoFactorEnabled: true,
            passwordStrength: 'strong',
            securityLevel: 'high'
        };

        // 初始化
        document.addEventListener('DOMContentLoaded', function() {
            initEventListeners();
            simulateLoading();
            
            // 模拟安全数据加载
            setTimeout(() => {
                updateSecurityDisplay();
            }, 1000);
        });

        // 初始化事件监听器
        function initEventListeners() {
            // 返回按钮
            document.getElementById('backBtn').addEventListener('click', function() {
                window.history.back();
            });

            // 刷新按钮
            document.getElementById('refreshBtn').addEventListener('click', function() {
                showSuccessToast('正在刷新安全状态...');
                simulateLoading();
                
                setTimeout(() => {
                    hideLoading();
                    showSuccessToast('安全状态已更新');
                }, 1500);
            });

            // 底部导航切换
            const navItems = document.querySelectorAll('.nav-item');
            navItems.forEach(item => {
                item.addEventListener('click', function() {
                    // 移除所有激活状态
                    navItems.forEach(i => i.classList.remove('active'));
                    // 添加当前激活状态
                    this.classList.add('active');
                    
                    const page = this.dataset.page;
                    handleNavigation(page);
                });
            });

            // 安全设置项点击事件
            const securityItems = document.querySelectorAll('.security-item');
            securityItems.forEach(item => {
                item.addEventListener('click', function() {
                    const settingId = this.id;
                    handleSecuritySettingClick(settingId);
                });
            });

            // 紧急联系人编辑
            const emergencyEditBtn = document.querySelector('.emergency-contact .action-btn');
            if (emergencyEditBtn) {
                emergencyEditBtn.addEventListener('click', function() {
                    alert('跳转到紧急联系人设置页面');
                });
            }

            // 安全检测弹窗
            document.getElementById('securityCheck').addEventListener('click', function() {
                const modal = document.getElementById('securityCheckModal');
                modal.classList.add('show');
            });

            // 安全检测确认按钮
            document.getElementById('confirmCheckBtn').addEventListener('click', function() {
                showSuccessToast('安全检测开始...');
                closeSecurityCheckModal();
                
                simulateLoading();
                setTimeout(() => {
                    hideLoading();
                    showSuccessToast('安全检测完成，账户状态正常');
                }, 2000);
            });

            // 安全检测取消按钮
            document.getElementById('cancelCheckBtn').addEventListener('click', closeSecurityCheckModal);

            // 安全检测弹窗背景点击关闭
            document.getElementById('securityCheckModal').addEventListener('click', function(e) {
                if (e.target === this) {
                    closeSecurityCheckModal();
                }
            });

            // 模拟安全数据更新
            setInterval(() => {
                updateSecurityDisplay();
            }, 60000); // 每分钟更新一次
        }

        // 关闭安全检测弹窗
        function closeSecurityCheckModal() {
            const modal = document.getElementById('securityCheckModal');
            modal.classList.remove('show');
        }

        // 处理安全设置项点击
        function handleSecuritySettingClick(settingId) {
            switch(settingId) {
                case 'identityVerification':
                    alert('跳转到实名认证页面');
                    break;
                case 'passwordManagement':
                    alert('跳转到密码管理页面');
                    break;
                case 'twoFactorAuth':
                    alert('跳转到双重验证设置页面');
                    break;
                case 'loginDevices':
                    alert('跳转到登录设备管理页面');
                    break;
                case 'privacySettings':
                    alert('跳转到隐私设置页面');
                    break;
                case 'emergencyContact':
                    alert('跳转到紧急联系人设置页面');
                    break;
                case 'securityCheck':
                    // 弹出检测确认
                    const modal = document.getElementById('securityCheckModal');
                    modal.classList.add('show');
                    break;
                case 'securityLog':
                    alert('跳转到安全日志页面');
                    break;
                case 'reportComplaint':
                    alert('跳转到举报投诉页面');
                    break;
                case 'securityLevel':
                    alert('查看安全等级详情');
                    break;
            }
        }

        // 更新安全显示状态
        function updateSecurityDisplay() {
            // 模拟更新安全数据
            securityData = {
                identityVerified: true,
                twoFactorEnabled: true,
                passwordStrength: 'strong',
                securityLevel: 'high'
            };
            
            // 更新安全等级显示
            const levelBadge = document.querySelector('.security-level-badge');
            if (levelBadge) {
                levelBadge.textContent = securityData.securityLevel === 'high' ? '高' : 
                                       securityData.securityLevel === 'medium' ? '中等' : '低';
                levelBadge.className = 'security-status-badge badge-' + 
                                     (securityData.securityLevel === 'high' ? 'verified' : 
                                      securityData.securityLevel === 'medium' ? 'warning' : 'warning');
            }
        }

        // 处理导航切换
        function handleNavigation(page) {
            switch(page) {
                case 'home':
                    alert('跳转到首页');
                    break;
                case 'search':
                    alert('跳转到搜索页面');
                    break;
                case 'publish':
                    alert('跳转到发布页面');
                    break;
                case 'profile':
                    // 个人中心无需特殊处理
                    break;
            }
        }

        // 显示加载状态
        function showLoading() {
            const loading = document.getElementById('loadingIndicator');
            loading.style.display = 'block';
        }

        // 隐藏加载状态
        function hideLoading() {
            const loading = document.getElementById('loadingIndicator');
            loading.style.display = 'none';
        }

        // 模拟加载效果
        function simulateLoading() {
            showLoading();
            setTimeout(() => {
                hideLoading();
            }, 1500);
        }

        // 显示成功提示
        function showSuccessToast(message) {
            const toast = document.getElementById('toast');
            toast.textContent = message;
            toast.style.display = 'block';
            
            // 3秒后自动隐藏
            setTimeout(() => {
                toast.style.display = 'none';
            }, 3000);
        }

        // 添加触摸反馈效果
        const buttons = document.querySelectorAll('button, .security-item');
        buttons.forEach(button => {
            button.addEventListener('touchstart', function() {
                this.style.transform = 'scale(0.98)';
            });
            
            button.addEventListener('touchend', function() {
                this.style.transform = 'scale(1)';
            });
        });

        // 添加页面滚动效果
        let lastScrollTop = 0;
        window.addEventListener('scroll', function() {
            const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
            
            // 隐藏/显示底部导航
            const bottomNav = document.querySelector('.bottom-nav');
            if (scrollTop > lastScrollTop && scrollTop > 100) {
                bottomNav.style.transform = 'translateY(100%)';
            } else {
                bottomNav.style.transform = 'translateY(0)';
            }
            
            lastScrollTop = scrollTop;
        });

        // 添加返回顶部功能
        window.addEventListener('scroll', function() {
            if (window.pageYOffset > 300) {
                // 可以添加返回顶部按钮
            }
        });
    </script>
</body>
</html>
